//
// Created by zhangyue26 on 2020/7/23.
//
#include <stdio.h>
/**
 * String类型指针示例
 */
void stringPoint1(){
    char *string = "String类型指针示例\n";
    printf(string);//字符串指针可以直接输出指针则就会输出字符串
}
/**
 * 指针与字符串数组
 */
void stringPoint2(){
    char str1[] = "指针与字符串数组", str2[30], *p1, *p2;
    p1 = str1;
    p2 = str2;
    printf("直接输出指针数组的指针p1为：%s\n", p1);
    while (*p1 != '\0') {   //字符串数组指针之间的赋值
        *p2 = *p1;
        p1++;
        p2++;
    }
    *p2 = '\0';
    printf("现在第二个字符串内容为：");
    printf(str1);

}
/**
 * 字符串二位数组指针
 */
void stringPoint3(){
    char stringArr[12][10] = {"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"};
    char *stringArrPoint = stringArr[0];
    for (int i = 0; i < 120; ++i) {
        printf("字符串：%s\n", stringArrPoint);
        stringArrPoint += 10;
    }

}